package com.edu.base.common.vo;

import com.google.common.collect.Maps;

import java.util.Map;

/**
 * 登录注册枚举类型
 * 主要登录注册时，不同错误的代码及描述
 * @author admin
 *
 */
public enum LoginRegisterEnum {

	LOGIN_FAIL("40","112","登录失败"),
	VERIFYCODE_ERROR("20","120","手机号与验证码不符！"),//验证码错误
	PHONE_BE_REGISTER("21","121","手机号已被注册！"),//手机号已被注册
	USER_NOT_EXIST("22","122","手机号未注册！"),//用户不存在
	USER_BE_FREEZE("23","888","该账号已被冻结，请联系平台！"),//账号被禁用
	USER_NOT_SET_PASSWORD("24","124","该手机号没有设置密码，请通过忘记密码进行设置！"),//没有设置密码
	PASSWORD_NOT_CORECCT("25","125","手机号或密码错误！"),//手机号或密码错误
	COMPARE_PASSWORD_NOT_CORECCT("26","126","原密码输入的不正确！"),//原密码输入的不正确
	CODE_LOSSE("27","127","手机号与验证码不匹配或验证码已失效，请重新获取！"),//验证码已经失效，也就是过了redis缓存的时间，在redis中取不到值
	THIRD_TYPE_WECHART("101"),// 第三方:微信
	THIRD_TYPE_QQ("102"),// 第三方:qq
	THIRD_TYPE_MICROBLOG("103"),// 第三方:微博
	THIRD_TYPE_APPLE("104"),// 第三方:苹果
	CHICK_PASSWORD_CONFIRMPASSWORD("28","128","两次密码输入不一致，请重新输入！");


	private String messType;//消息类型代码
	private String errorStatus;//错误代码
	private String errorMessage;//错误描述
  
	private LoginRegisterEnum(String messType) {
		this.messType = messType;
	}
	
	private LoginRegisterEnum(String messType, String errorStatus, String errorMessage) {
		this.messType = messType;
		this.errorStatus = errorStatus;
		this.errorMessage = errorMessage;
	}

	public String getMessType() {
		return messType;
	}

	public void setMessType(String messType) {
		this.messType = messType;
	}

	public String getErrorStatus() {
		return errorStatus;
	}

	public void setErrorStatus(String errorStatus) {
		this.errorStatus = errorStatus;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public void setErrorMessage(String errorMessage) {
		this.errorMessage = errorMessage;
	}
	
	public static Map<String, Object> buildReturnMap(LoginRegisterEnum vce) {
		Map<String, Object> mo=Maps.newHashMap();
		mo.put("errorStatus", vce.getErrorStatus());
		mo.put("errorMessage", vce.getErrorMessage());
		return mo;
	}
}
